﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminCP/admincp.Master" AutoEventWireup="true" CodeBehind="SendMails.aspx.cs" Inherits="VINETLIFE.AdminCP.SendMails" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    
        <script type="text/javascript">
            function OnClientPasteHtml(sender, args) {
                var commandName = args.get_commandName();
                var value = args.get_value();
                if (commandName == "ImageManager") {
                    //See if an img has an alt tag set
                    var div = document.createElement("DIV");
                    //Do not use div.innerHTML as in IE this would cause the image's src or the link's href to be converted to absolute path.
                    //This is a severe IE quirk.
                    Telerik.Web.UI.Editor.Utils.setElementInnerHtml(div, value);
                    //Now check if there is alt attribute
                    var img = div.firstChild;
                    //alert(div.innerHTML);

                    //Set new content to be pasted into the editor

                    if (!!img.alt) {
                        var newInner = "<center>";
                        newInner = newInner + "<img src='" + img.src + "' alt='" + img.alt + "'/></center><center>";
                        newInner = newInner + img.alt + "</center>";

                        args.set_value(newInner);
                    }
                    else {
                        var newInner = "<center><img src='" + img.src + "' alt='Bao Anh jsc'/></center><br/>";

                        args.set_value(newInner);
                    }

                }
            }
        </script>
    </telerik:RadCodeBlock>
    <script type="text/javascript">
        function SelectAndClosePopup(value) {
            cbParent.SetValue(value);
            pcParent.Hide();
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<fieldset class="fieldset">
      <legend>Chọn Email khách hàng</legend>
       <p style="margin-bottom: 10px; color: Blue"><strong><b>Email in đậm là Email khách hàng đã đăng ký thành viên</b></strong></p>
        <div>
          <asp:CheckBoxList Width="500px" CssClass="checkListEmail" ID="checkListEmail" runat="server" />
        </div>
        <div style="margin: 5px 0px">
          <asp:Button ID="checkAll" runat="server" Text="Chọn tất cả" 
            CssClass="button" onclick="checkAll_Click" />&nbsp; &nbsp;
          <asp:Button ID="uncheckAll" runat="server" Text="Bỏ chọn tất cả"  
            CssClass="button" onclick="uncheckAll_Click" />&nbsp; &nbsp;
          <asp:Button ID="checkMember" runat="server" Text="Chọn thành viên"  
            CssClass="button" onclick="checkMember_Click" />&nbsp; &nbsp;
          <asp:Button ID="checkEmail" runat="server" 
            Text="Chọn không phải thành viên"  CssClass="button" 
            onclick="checkEmail_Click" />&nbsp; &nbsp;
        </div>
       <div style="margin: 5px 0px">   
       <p>Tiêu đề thư</p>
        <p><asp:TextBox ID="txtTitle" runat="server" CssClass="textBox" Width="930px" /></p>
        </div>
        <div style="margin: 5px 0px">  
          <p>Nội dung</p>        
          <p>
            &nbsp;<telerik:RadEditor ID="txtDetail" runat="server" OnClientPasteHtml="OnClientPasteHtml"
                    DialogHandlerUrl="~/Telerik.Web.UI.DialogHandler.axd" Width="99%" Height="700px">
                    <ImageManager MaxUploadFileSize="1024000000" ViewMode="Grid" DeletePaths="~/Media/"
                        UploadPaths="~/Media/" ViewPaths="~/Media/"></ImageManager>
                </telerik:RadEditor>
          </p>
        </div>
        <div style="margin: 5px 0px">
          <asp:Button ID="btnSend" runat="server" Text="Gửi email" CssClass="button" 
            onclick="btnSend_Click" />
        </div>
      </fieldset>
      <asp:Literal ID="ltThongBao" runat="server" />
</asp:Content>
